package encrypto

import (
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"
	"log"
)

func clientWithTLS() {
	creds, err := credentials.NewClientTLSFromFile("server.crt", "")
	if err != nil {
		log.Fatalf("failed to load TLS: %v", err)
	}

	conn, err := grpc.Dial("localhost:50051", grpc.WithTransportCredentials(creds))
	// ... 使用连接
}